<?php

namespace app\http\middleware;

use think\facade\Response;
use Zewail\Api\Facades\JWT;

class AdminAuth
{
    use \app\http\Responser;

    public function handle($request, \Closure $next)
    {

        if (! JWT::authenticate()) {
//            return redirect('guest/login');

//            return json('auth error');
            return $this->resAlert('认证失败, 请重新登入!');
        }

        return $next($request);
    }
}
